<template>

    <div>
        <div v-for="(tval, tkey, index) in ts" :key="index">
            <span>{{tkey}}： </span>
            <el-checkbox-group v-model="msg.tags" style="display:inline-block">
                <template v-for="(t, idx) in tval">
                    <el-checkbox :label="t" :key="idx"></el-checkbox>
                </template>
            </el-checkbox-group>
        </div>
    </div>
</template>

<script>
import Axios from 'axios'

let apiUrl = 'http://172.30.11.152/api/data/tags/list/'

export default {
    props:[
        "msg"
    ],
    data(){
        return {
            ts:{}
        }
    },
    mounted(){
        getTagsData().then(data=>{
            this.ts = data
        })
    }
}

async function getTagsData(){
    let result = []
    const url = apiUrl
    await Axios.get(url).then(res=>{
        result = res.data.data
    })
    return result
}
</script>

<style scoped>

</style>
